from selenium import webdriver
from lib2to3.pgen2 import driver
from time import sleep


class GetTitle:

    def gettitle(url):
        # 启动浏览器
        driver = webdriver.Chrome()
        driver.get(url)
        driver.implicitly_wait(10)
        driver.find_element("partial link text", "图片").click()
        sleep(2)
        # 调用driver的title属性获取页面的title属性值
        title = driver.title
        print("当前网页的title属性值为: ", title)
        turl = driver.current_url
        print("当前网页网址为：", turl)
        driver.quit()

a = GetTitle
a.gettitle("https://www.baidu.com")






